package com.heima.wemedia.feign;

import com.heima.apis.sensitive.ISensitiveClient;
import com.heima.model.admin.dtos.SensitiveDto;
import com.heima.model.common.dtos.PageResponseResult;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.wemedia.pojos.WmSensitive;
import com.heima.wemedia.service.WmSensitiveService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created with IntelliJ IDEA
 *
 * @Author: ljl
 * @Date: 2022/11/16/21:47
 * @Description:
 */
@Slf4j
@RestController
public class WmSensitiveClient implements ISensitiveClient{
    @Autowired
    private WmSensitiveService wmSensitiveService;

    /**
     * 查询列表
     * @return
     */
    @Override
    public PageResponseResult wmSensitiveList(SensitiveDto sensitiveDto) {
            log.info("查询所有：{}",sensitiveDto);
            return wmSensitiveService.wmSensitiveList(sensitiveDto);
    }

    /**
     * 根据id删除敏感词
     * @param id
     * @return
     */
    @Override
    public ResponseResult wmSensitiveDeleteById(Integer id) {
        return wmSensitiveService.wmSensitiveDeleteById(id);
    }

    /**
     * 保存敏感词
     * @param wmSensitive
     * @return
     */
    @Override
    public ResponseResult wmSensitiveSave(WmSensitive wmSensitive) {
        return wmSensitiveService.wmSensitiveSave(wmSensitive);
    }

    /**
     * 更新敏感词
     */
    @Override
    public ResponseResult wmSensitiveUpdate(WmSensitive wmSensitive) {
        return wmSensitiveService.wmSensitiveUpdate(wmSensitive);
    }

    @Override
    public ResponseResult getAll() {
        return wmSensitiveService.getAll();
    }

}
